package model

/**
  * author: HuaZhe Ray
  *
  * describe: TODO
  *
  * createDate: 2017/12/7
  * createTime: 17:16
  *
  * 使用了样例类
  * 实现了apply方法
  * 构造参数默认被声明为val
  */
//class Student (val name: String,var sex:Char,val Chinese:String,val math:String,val english:String) {
case class Student ( /*val*/name: String,sex:String,chinese:Lesson, math:Lesson,english:Lesson) {

//  println(" I'm Student constructor. ")

  /*def test(): Unit ={
    val lesson = new Lesson()
  }*/
  //已经覆盖
  override def toString: String = {
    "Student:[ name: "+name + " sex: "+sex+" chinese: "+chinese+" math: "+math+" english: "+english + " ]"
  }

  def totalPoints(): Int ={
    chinese.point + math.point + english.point
  }


  def chinesePoints  = chinese.point

  def mathPoints     = math.point

  def englishPoints  = english.point

}

case class StudentWrapper(name:String,sex:String,chinese:Int, math:Int,english:Int) {

}
